package cn.bs.securitystudy.controller;


import cn.bs.securitystudy.pojo.User;
import cn.bs.securitystudy.service.LoginService;
import cn.bs.securitystudy.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/user")
public class LoginController {
    @Autowired
    private LoginService loginService;

    //自定义登录接口
    @PostMapping("/login")
    public ResponseResult login(User user) {
           return loginService.login(user);
    }

    //退出登录
    @GetMapping("/logout")
    public ResponseResult logout() {
        return loginService.logout();
    }

}
